"""
构造方法
"""
class Student:
    # 成员属性-构造中有的可省略
    # name = None         # 姓名
    # age = None          # 年龄
    def __init__(self, name, age,tel=None):
        self.name = name
        self.age = age
        self.tel = tel

    def study(self, course_name):
        print(f"{self.name}正在学习{course_name}")

    def watch_movie(self):
        if self.age < 18:
            print(f"{self.name}只能观看《熊出没》")
        else:
            print(f"{self.name}正在观看大电影")
# 构建对象
stu1 = Student("张大帅",20,13653275)
stu1.study("Python程序设计")
stu1.watch_movie()
print(f"{stu1.name}的电话号码为:{stu1.tel}")